public class HomeWork011410 {
    public static void main(String[] args) {
        int count =0;
        for(int j = 2;j <= 1000;j++){
            int num = j;
            boolean isPrime = true;
            for(int i = 2; i <= num/2;i++){
                if(num%i == 0){
                    isPrime = false ;

                }
            }
            if (isPrime) {
            //计数器加1
                count++;
                System.out.println(num + " ");
                if(count == 8){
                    System.out.println();
                /*if(count% 8 == 0){
                    System.out.println(num + " ");*/
                    count = 0 ;
                }

            }
        }
    }
}
